//引入express
const express = require('express');
//创建路由器对象
const router = new express.Router();


//router后面可以直接些写路由
router.get('/test',(req,res)=>{
    console.log(req.query);
    res.send('测试get请求！');
})
//registet
router.post('/register',(req,res)=>{
    console.log(req.body);
    res.send('注册成功！');
})
router.post('/login',(req,res)=>{
    console.log(req.body);
    res.send('登录成功！');
})
//暴露出去
module.exports = router;